/*
 * Copyright (C) 2024-2025 Deepin Technology Co., Ltd.
 *
 * Author:     zhangbingyi <zhangbingyi@uniontech.com>
 *
 * Maintainer: zhangbingyi <zhangbingyi@uniontech.com>
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
#pragma once

//#include "dateusagewidgets/appdatachart.h"
#include "datausagemodel.h"
#include "common.h"

//#include <DBlurEffectWidget>
//#include <DFrame>
//#include <DLabel>
//#include <DPushButton>
//#include <DTipLabel>

#include <QWidget>
#include <QFrame>
#include <QLabel>
#include <QPushButton>

QT_BEGIN_NAMESPACE
class QVBoxLayout;
class QHBoxLayout;
class QLabel;
class QPushButton;
QT_END_NAMESPACE


class NetworkProtectionModel;
class NetworkProtectionWorker;
class AppDataDetailDialog : public QFrame
{
    Q_OBJECT
public:
    explicit AppDataDetailDialog(QString appname = "", QString pidname = "", QString icon = "",
                                 DataUsageModel *model = nullptr, QWidget *parent = nullptr);
public Q_SLOTS:
    void selectTimeRangeStyle(QAction *action);

    void dpkgQueryOut();
protected:
    void resizeEvent(QResizeEvent *event);
    void closeEvent(QCloseEvent *event);

private:
    void initUI();
    //更新此时间段应用总流量数据
    void updateThisRangeUsageNum();

private:
    DataUsageModel *m_model;
//    DBlurEffectWidget *m_blurEffect;
    QWidget *m_mainWidgt;
    QString m_appName;
    QString m_pkgName;
    QString m_appIcon;
    QLabel *m_totalUsageNum;
    QLabel *m_downloadedUsageNum;
    QLabel *m_uploadedUsageNum;
    QPushButton *m_timeRangeSelect;
//    AppDataChart *m_chart;
    QLabel *m_appVersion;
};
